<template>
    <div class="homt-recommend">
        <p class="title">猜你喜欢</p>
        <div class="list">
            <div class="item" v-for="item in dt" @click="toDetail(item.id)">
                <img :src="item.imgUrl" alt="">
                <div class="content">
                    <p>{{ item.title }}</p>
                    <p>{{ item.desc }}</p>
                    <p><span class="price">￥205</span><span class="frt">北京</span></p>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "HomeRecommend",
        props: ['dt'],
        methods: {
            toDetail(id) {
                // 跳转到详情页面
                this.$router.push('/detail/'+id)
            }
        }
    }
</script>

<style scoped>
    .homt-recommend {
        padding: 0 10px;
        box-sizing: border-box;
    }
    .title {
        font-size: 14px;
        padding-top: 20px;
    }
    .item {
        display: flex;
        padding: 10px 0;
        border-bottom: 1px solid #eeeeee;
    }
    .item img {
        width: 100px;
    }
    .content {
        flex: 1;
        margin-left: 10px;
        box-sizing: border-box;
        font-size: 15px;
        padding-top: 5px;
    }
    .content p:nth-of-type(2) {
        margin: 20px 0;
    }
    .price {
        color: rgb(255,147,0);
        font-weight: bold;
    }

</style>